home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1999 #3
/
Amiga Plus CD - 1999 - No. 3.iso
/
System
/
mainactor
/
rexx
/
dither_adpro.ma
< prev
next >
Wrap
Text File
|
1977-12-31
|
3KB
|
139 lines
/*
*
* Dither V 1.1, 1993 Markus Moenig
*
* Dithers the source project to a requested amount of colours, needs AdPro !!
* The new project will also be in the format of the selected save module.
*
* The loader/saver of the source project can be either picture
* or animation modules.
*
* A new project will be opened for the resulting pictures/animation.
*/
OPTIONS RESULTS
ADDRESS MAINACTOR
ScreenToFront
PrintAndStoreTXT "Dither V1.1, dithering project ..."
IF ~SHOW('P','ADPro') THEN DO /* if not allready running, start adpro */
ADDRESS MAINACTOR PrintTXT "Invoking AdPro ..."
ADDRESS COMMAND 'run >NIL: <NIL: adpro:adpro BEHIND MAXMEM=1000000'
ADDRESS COMMAND Wait 5
END
ADDRESS MAINACTOR
GetSPName
IF rc = 0 THEN DO /* check if project loaded */
PARSE VAR RESULT firstname secondname . /* store name of the animation */
/* or the names of the picture list */
ScreenToFront
DeSelectAll
GetSPSaver
PARSE VAR RESULT savertype savername . /* store type, name of saver module */
/* Store general infos of the project */
GetSPInfo
PARSE VAR RESULT width height colors pics caching loop cpf .
colors=16
RequestInteger colors "Enter amount of Colours (0=HAM, 1=HAM8)"
IF RC = 10 THEN DO
PrintTXT "Aborting ..."
EXIT
END
NewColors=RESULT
IF NewColors = 0 THEN NewColors="HAM"
IF NewColors = 1 THEN NewColors="HAM8"
IF savertype = "PIC" THEN
picformat=savername
ELSE DO
picformat=IFF
SetSPSaver PIC picformat
END
ADDRESS "ADPro"
LFormat "Universal"
PSTATUS UNLOCKED
ORIENTATION PORTRAIT
SFormat picformat
ADDRESS MAINACTOR
RequestSaveFile "Select Name of Project" /* Ask for Project Name */
IF RC = 10 THEN DO
PrintTXT "Aborting ..."
EXIT
END
newname = RESULT /* new name = RESULT */
SelectAll
saveargs=newname
Save saveargs /* Save Pictures */
DO i=1 to pics /* Scale all pics */
actualpic=newname || "." || Right("00000" || i, 5)
PrintTxt "ADPro dithers Picture" i
ADDRESS "ADPro"
Load actualpic
RENDER_TYPE NewColors
PSORT 0
Execute
Save actualpic IMAGE
ADDRESS MAINACTOR
END
IF caching = "CACHING=YES" THEN /* Was the old project cached ? */
OpenNewProject "CACHING" /* If yes new project is also cached */
ELSE
OpenNewProject /* If not new project is not cached */
SetSPLoader PIC picformat /* Set the new projects loader module */
firstpic=newname || "." || Right("00000" || 1, 5)
lastpic=newname || "." || Right("00000" || pics, 5)
LoadProject firstpic lastpic /* Load picture list */
SetSPSaver savertype savername
IF savertype = "ANIM" THEN DO /* If we wanted a new animation, */
/* we have to build it */
SelectAll
saveargs=newname || " " || cpf || " " || loop
Save saveargs
UnloadProject
DO i=1 TO pics /* delete temporary pics */
actualpic=newname || "." || Right("00000" || i, 5)
PrintTxt "Delete " || actualpic
ADDRESS COMMAND "delete " || actualpic || "#?"
END
SetSPLoader savertype savername
LoadProject newname
END
PrintAndStoreTXT "READY !!!!"
END